import 'package:flutter_test/flutter_test.dart';
import 'package:my_add_calendar/Calendars.dart';
import 'package:my_add_calendar/my_add_calendar.dart';
import 'package:my_add_calendar/my_add_calendar_platform_interface.dart';
import 'package:my_add_calendar/my_add_calendar_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockMyAddCalendarPlatform
    with MockPlatformInterfaceMixin
    implements MyAddCalendarPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');

  @override
  Future<bool> checkReadPermission() {
    // TODO: implement checkReadPermission
    throw UnimplementedError();
  }

  @override
  Future<bool> checkWritePermission() {
    // TODO: implement checkWritePermission
    throw UnimplementedError();
  }

  @override
  Future<String> createEvent(Calendars calendars) {
    // TODO: implement createEvent
    throw UnimplementedError();
  }

  @override
  Future<bool> deleteEvent(String eventId) {
    // TODO: implement deleteEvent
    throw UnimplementedError();
  }

  @override
  Future<String> updateEvent(Calendars calendars) {
    // TODO: implement updateEvent
    throw UnimplementedError();
  }
}

void main() {
  final MyAddCalendarPlatform initialPlatform = MyAddCalendarPlatform.instance;

  test('$MethodChannelMyAddCalendar is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelMyAddCalendar>());
  });

  test('getPlatformVersion', () async {
    MyAddCalendar myAddCalendarPlugin = MyAddCalendar();
    MockMyAddCalendarPlatform fakePlatform = MockMyAddCalendarPlatform();
    MyAddCalendarPlatform.instance = fakePlatform;

    expect(await myAddCalendarPlugin.getPlatformVersion(), '42');
  });
}
